package GameEngine.Demo.JR;

import processing.core.PApplet;
import GameEngine.helper.PAppletBridge;

public class jr1 extends PApplet {

	// Level 1 besteht aus drei Layern
	private JRLevelOne level1;
	private int posx = 0;

	public void setup() {
		size(40 * 16, 25 * 16);
		frameRate(200);
		// Bridge zu PApplet muss gesetzt werden
		PAppletBridge pab = new PAppletBridge(this);

		// ab hier ist kann initialisiert werden

		level1 = new JRLevelOne();
	}

	public void draw() {
		background(0xff33198B);
		posx = -mouseX * 15;
		
		drawLLevel1();
	}

	private void drawLLevel1() {
		// Layer 1
		level1.getLayer(0).PosX = posx;
		level1.getLayer(0).PosY = -50;
		// Layer 0
		level1.getLayer(1).PosX = posx;
		level1.getLayer(1).PosY = -332;

		level1.draw();

	}

	public void mousePressed() {
		System.out.println(frameRate);
	}

	static public void main(String[] passedArgs) {
		String[] appletArgs = new String[] { "GameEngine.Demo.JR.jr1" };
		if (passedArgs != null) {
			PApplet.main(concat(appletArgs, passedArgs));
		} else {
			PApplet.main(appletArgs);
		}
	}
}
